package com.sharemarking.system.mapper;

import com.sharemarking.system.dto.personManagement.DriverAttachmentDto;
import com.sharemarking.system.dto.personManagement.DriverInfoDto;
import com.sharemarking.system.dto.personManagement.PersonListDto;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author dxy
 */
@Repository
public interface PersonManagementMapper {
    List<PersonListDto> getDispatcherList(Map map);

    Integer getDispatcherListTotal(Map map);

    List<PersonListDto> getDriverList(Map map);

    Integer getDriverListTotal(Map map);

    @Select("SELECT a.id,a.name,a.head_img,IFNULL(b.real_name,b.name) AS orgName FROM wa_driver_verify a LEFT JOIN sys_org b ON a.org_id = b.id " +
            "WHERE a.member_id = #{id}")
    DriverInfoDto getDriverInfo(Integer id);

    @Select("SELECT type,attachment FROM wa_driver_attachment WHERE driver_verify_id = #{id}")
    List<DriverAttachmentDto> getDriverAttachment(Integer id);
}
